package cn.nubia.admin.application;


import cn.nubia.admin.application.apk.entity.ApkInfo;
import cn.nubia.admin.application.apk.utils.ApkUtil;

public class Demo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			String apkpath = "/Users/justin/Documents/java/workspace/demo-web/src/main/resources/"+"baidushoujizhushouyuan.apk";
			String outPath = "/Users/justin/Documents/java/workspace/demo-web/src/main/resources/";
			if (args.length > 0) {
				apkpath = args[0];
			}
			ApkInfo apkInfo = new ApkUtil().getApkInfo(apkpath);
			// 打印获取到的信息
			System.out.println(apkInfo);
			// 获取Icon并保存到指定位置
//			IconUtil.extractFileFromApk(apkpath, apkInfo.getApplicationIcon(), "/Users/justin/Documents/java/workspace/demo-web/src/main/resources/"+"icon.png");
//			for(String key : apkInfo.getApplicationIcons().keySet()){
//				System.out.println(key);
//				IconUtil.extractFileFromApk(apkpath,apkInfo.getApplicationIcons().get(key),outPath+key+".png");
//			}
//			Thumbnails.of("/Users/justin/Documents/java/workspace/demo-web/src/main/resources/"+"icon.png").forceSize(300,200)
//					.toFile("/Users/justin/Documents/java/workspace/demo-web/src/main/resources/"+"icon300*200.png");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
